﻿@model VocaDb.Model.DataContracts.Songs.SongListContract[]
@using VocaDb.Model.Domain.Songs;

@{

	var byCategory = Model.Where(l => l.FeaturedCategory != SongListFeaturedCategory.Nothing).GroupBy(l => l.FeaturedCategory);
	//var categories = byCategory.Select(c => new {CategoryName = VocaDb.Web.Helpers.Translate.SongListFeaturedCategoryNames[c.Key], Lists = c.ToArray()});
	var customLists = Model.Where(l => l.FeaturedCategory == SongListFeaturedCategory.Nothing).ToArray();
	
}

@foreach (var category in byCategory) {
	
	<h4>@VocaDb.Web.Helpers.Translate.SongListFeaturedCategoryNames[category.Key]</h4>
	
	foreach (var list in category) {
		<a href="@Url.Action("Details", "SongList", new { id = list.Id })">@list.Name</a>
		<br />
	}
	
	<br />
	
}

@if (customLists.Any()) {
	
	<h4>@ViewRes.Song.DetailsStrings.CustomLists</h4>
	
	foreach (var list in customLists) {
		<a href="@Url.Action("Details", "SongList", new { id = list.Id })">@list.Name</a>				
		@("(")@UserHelpers.UserIconLink(list.Author)@(")")
		<br />
	}
	
}